/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "SmfRegistration.h"

namespace oai::udr::model {

SmfRegistration::SmfRegistration() {
  m_SmfInstanceId = "";
  m_SmfSetId = "";
  m_SmfSetIdIsSet = false;
  m_SupportedFeatures = "";
  m_SupportedFeaturesIsSet = false;
  m_PduSessionId = 0;
  m_Dnn = "";
  m_DnnIsSet = false;
  m_EmergencyServices = false;
  m_EmergencyServicesIsSet = false;
  m_PcscfRestorationCallbackUri = "";
  m_PcscfRestorationCallbackUriIsSet = false;
  m_PgwFqdn = "";
  m_PgwFqdnIsSet = false;
  m_EpdgInd = false;
  m_EpdgIndIsSet = false;
  m_DeregCallbackUri = "";
  m_DeregCallbackUriIsSet = false;
  m_RegistrationReasonIsSet = false;
  m_RegistrationTime = "";
  m_RegistrationTimeIsSet = false;
  m_ContextInfoIsSet = false;
}

SmfRegistration::~SmfRegistration() {}

void SmfRegistration::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const SmfRegistration &o) {
  j = nlohmann::json();
  j["smfInstanceId"] = o.m_SmfInstanceId;
  if (o.smfSetIdIsSet())
    j["smfSetId"] = o.m_SmfSetId;
  if (o.supportedFeaturesIsSet())
    j["supportedFeatures"] = o.m_SupportedFeatures;
  j["pduSessionId"] = o.m_PduSessionId;
  j["singleNssai"] = o.m_SingleNssai;
  if (o.dnnIsSet())
    j["dnn"] = o.m_Dnn;
  if (o.emergencyServicesIsSet())
    j["emergencyServices"] = o.m_EmergencyServices;
  if (o.pcscfRestorationCallbackUriIsSet())
    j["pcscfRestorationCallbackUri"] = o.m_PcscfRestorationCallbackUri;
  j["plmnId"] = o.m_PlmnId;
  if (o.pgwFqdnIsSet())
    j["pgwFqdn"] = o.m_PgwFqdn;
  if (o.epdgIndIsSet())
    j["epdgInd"] = o.m_EpdgInd;
  if (o.deregCallbackUriIsSet())
    j["deregCallbackUri"] = o.m_DeregCallbackUri;
  if (o.registrationReasonIsSet())
    j["registrationReason"] = o.m_RegistrationReason;
  if (o.registrationTimeIsSet())
    j["registrationTime"] = o.m_RegistrationTime;
  if (o.contextInfoIsSet())
    j["contextInfo"] = o.m_ContextInfo;
}

void from_json(const nlohmann::json &j, SmfRegistration &o) {
  j.at("smfInstanceId").get_to(o.m_SmfInstanceId);
  if (j.find("smfSetId") != j.end()) {
    j.at("smfSetId").get_to(o.m_SmfSetId);
    o.m_SmfSetIdIsSet = true;
  }
  if (j.find("supportedFeatures") != j.end()) {
    j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
    o.m_SupportedFeaturesIsSet = true;
  }
  j.at("pduSessionId").get_to(o.m_PduSessionId);
  j.at("singleNssai").get_to(o.m_SingleNssai);
  if (j.find("dnn") != j.end()) {
    j.at("dnn").get_to(o.m_Dnn);
    o.m_DnnIsSet = true;
  }
  if (j.find("emergencyServices") != j.end()) {
    j.at("emergencyServices").get_to(o.m_EmergencyServices);
    o.m_EmergencyServicesIsSet = true;
  }
  if (j.find("pcscfRestorationCallbackUri") != j.end()) {
    j.at("pcscfRestorationCallbackUri").get_to(o.m_PcscfRestorationCallbackUri);
    o.m_PcscfRestorationCallbackUriIsSet = true;
  }
  j.at("plmnId").get_to(o.m_PlmnId);
  if (j.find("pgwFqdn") != j.end()) {
    j.at("pgwFqdn").get_to(o.m_PgwFqdn);
    o.m_PgwFqdnIsSet = true;
  }
  if (j.find("epdgInd") != j.end()) {
    j.at("epdgInd").get_to(o.m_EpdgInd);
    o.m_EpdgIndIsSet = true;
  }
  if (j.find("deregCallbackUri") != j.end()) {
    j.at("deregCallbackUri").get_to(o.m_DeregCallbackUri);
    o.m_DeregCallbackUriIsSet = true;
  }
  if (j.find("registrationReason") != j.end()) {
    j.at("registrationReason").get_to(o.m_RegistrationReason);
    o.m_RegistrationReasonIsSet = true;
  }
  if (j.find("registrationTime") != j.end()) {
    j.at("registrationTime").get_to(o.m_RegistrationTime);
    o.m_RegistrationTimeIsSet = true;
  }
  if (j.find("contextInfo") != j.end()) {
    j.at("contextInfo").get_to(o.m_ContextInfo);
    o.m_ContextInfoIsSet = true;
  }
}

std::string SmfRegistration::getSmfInstanceId() const {
  return m_SmfInstanceId;
}
void SmfRegistration::setSmfInstanceId(std::string const &value) {
  m_SmfInstanceId = value;
}
std::string SmfRegistration::getSmfSetId() const { return m_SmfSetId; }
void SmfRegistration::setSmfSetId(std::string const &value) {
  m_SmfSetId = value;
  m_SmfSetIdIsSet = true;
}
bool SmfRegistration::smfSetIdIsSet() const { return m_SmfSetIdIsSet; }
void SmfRegistration::unsetSmfSetId() { m_SmfSetIdIsSet = false; }
std::string SmfRegistration::getSupportedFeatures() const {
  return m_SupportedFeatures;
}
void SmfRegistration::setSupportedFeatures(std::string const &value) {
  m_SupportedFeatures = value;
  m_SupportedFeaturesIsSet = true;
}
bool SmfRegistration::supportedFeaturesIsSet() const {
  return m_SupportedFeaturesIsSet;
}
void SmfRegistration::unsetSupportedFeatures() {
  m_SupportedFeaturesIsSet = false;
}
int32_t SmfRegistration::getPduSessionId() const { return m_PduSessionId; }
void SmfRegistration::setPduSessionId(int32_t const value) {
  m_PduSessionId = value;
}
Snssai SmfRegistration::getSingleNssai() const { return m_SingleNssai; }
void SmfRegistration::setSingleNssai(Snssai const &value) {
  m_SingleNssai = value;
}
std::string SmfRegistration::getDnn() const { return m_Dnn; }
void SmfRegistration::setDnn(std::string const &value) {
  m_Dnn = value;
  m_DnnIsSet = true;
}
bool SmfRegistration::dnnIsSet() const { return m_DnnIsSet; }
void SmfRegistration::unsetDnn() { m_DnnIsSet = false; }
bool SmfRegistration::isEmergencyServices() const {
  return m_EmergencyServices;
}
void SmfRegistration::setEmergencyServices(bool const value) {
  m_EmergencyServices = value;
  m_EmergencyServicesIsSet = true;
}
bool SmfRegistration::emergencyServicesIsSet() const {
  return m_EmergencyServicesIsSet;
}
void SmfRegistration::unsetEmergencyServices() {
  m_EmergencyServicesIsSet = false;
}
std::string SmfRegistration::getPcscfRestorationCallbackUri() const {
  return m_PcscfRestorationCallbackUri;
}
void SmfRegistration::setPcscfRestorationCallbackUri(std::string const &value) {
  m_PcscfRestorationCallbackUri = value;
  m_PcscfRestorationCallbackUriIsSet = true;
}
bool SmfRegistration::pcscfRestorationCallbackUriIsSet() const {
  return m_PcscfRestorationCallbackUriIsSet;
}
void SmfRegistration::unsetPcscfRestorationCallbackUri() {
  m_PcscfRestorationCallbackUriIsSet = false;
}
PlmnId SmfRegistration::getPlmnId() const { return m_PlmnId; }
void SmfRegistration::setPlmnId(PlmnId const &value) { m_PlmnId = value; }
std::string SmfRegistration::getPgwFqdn() const { return m_PgwFqdn; }
void SmfRegistration::setPgwFqdn(std::string const &value) {
  m_PgwFqdn = value;
  m_PgwFqdnIsSet = true;
}
bool SmfRegistration::pgwFqdnIsSet() const { return m_PgwFqdnIsSet; }
void SmfRegistration::unsetPgwFqdn() { m_PgwFqdnIsSet = false; }
bool SmfRegistration::isEpdgInd() const { return m_EpdgInd; }
void SmfRegistration::setEpdgInd(bool const value) {
  m_EpdgInd = value;
  m_EpdgIndIsSet = true;
}
bool SmfRegistration::epdgIndIsSet() const { return m_EpdgIndIsSet; }
void SmfRegistration::unsetEpdgInd() { m_EpdgIndIsSet = false; }
std::string SmfRegistration::getDeregCallbackUri() const {
  return m_DeregCallbackUri;
}
void SmfRegistration::setDeregCallbackUri(std::string const &value) {
  m_DeregCallbackUri = value;
  m_DeregCallbackUriIsSet = true;
}
bool SmfRegistration::deregCallbackUriIsSet() const {
  return m_DeregCallbackUriIsSet;
}
void SmfRegistration::unsetDeregCallbackUri() {
  m_DeregCallbackUriIsSet = false;
}
RegistrationReason SmfRegistration::getRegistrationReason() const {
  return m_RegistrationReason;
}
void SmfRegistration::setRegistrationReason(RegistrationReason const &value) {
  m_RegistrationReason = value;
  m_RegistrationReasonIsSet = true;
}
bool SmfRegistration::registrationReasonIsSet() const {
  return m_RegistrationReasonIsSet;
}
void SmfRegistration::unsetRegistrationReason() {
  m_RegistrationReasonIsSet = false;
}
std::string SmfRegistration::getRegistrationTime() const {
  return m_RegistrationTime;
}
void SmfRegistration::setRegistrationTime(std::string const &value) {
  m_RegistrationTime = value;
  m_RegistrationTimeIsSet = true;
}
bool SmfRegistration::registrationTimeIsSet() const {
  return m_RegistrationTimeIsSet;
}
void SmfRegistration::unsetRegistrationTime() {
  m_RegistrationTimeIsSet = false;
}
ContextInfo SmfRegistration::getContextInfo() const { return m_ContextInfo; }
void SmfRegistration::setContextInfo(ContextInfo const &value) {
  m_ContextInfo = value;
  m_ContextInfoIsSet = true;
}
bool SmfRegistration::contextInfoIsSet() const { return m_ContextInfoIsSet; }
void SmfRegistration::unsetContextInfo() { m_ContextInfoIsSet = false; }

} // namespace oai::udr::model
